/*
 * Copyright 2025 The JA-SIG Collaborative. All rights reserved.
 * distributed with this file and available online at
 */
package com.lap.auth.application.login.command;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

@Data
@Schema(description = "创建登录日志命令")
public class CreateLoginLogCmd {

  @NotBlank(message = "{loginLog.userName.required}")
  @Length(max = 32, message = "{loginLog.userName.max.length}")
  @Schema(description = "登录账号")
  private String userName;

  @NotNull(message = "{loginLog.success.required}")
  @Range(min = -127, max = 128, message = "{loginLog.success.range}")
  @Schema(description = "登录状态:0-失败,1-成功")
  private Integer success;

  @Length(max = 128, message = "{loginLog.remark.max.length}")
  @Schema(description = "备注")
  private String remark;

  @NotNull(message = "{loginLog.times.required}")
  @Range(min = 0, max = 2147483647, message = "{loginLog.times.range}")
  @Schema(description = "耗时,单位毫秒")
  private long times;

  @Schema(description = "IP")
  private String ip;

  @Schema(description = "OS")
  private String os;

  @Schema(description = "浏览器")
  private String browser;

  @Schema(description = "设备")
  private String device;
}
